package com.owc.filter.content;

import com.owc.filter.authentication.Authentication;
import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;

/**
 * @Author Jackies
 * @Date 2019/12/8 11:32
 * @Description TODO://
 **/
public interface SecurityContext {

    /**
     * Gets the currently authenticated principal.
     *
     * @return the Authentication or null if authentication information is unavailable
     */
    @Nullable
    Authentication getAuthentication();


    /**
     * Changes the currently authenticated principal, or removes the authentication information.
     *
     * @param authentication the new authentication or null if no further authentication should not be stored
     */
    void setAuthentication(@NonNull Authentication authentication);

}
